package com.sto.stoapp.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/**
 * BaseAdapter基类
 * 
 * @author mgf
 * 
 */
public class StoBaseAdapter extends BaseAdapter {

	/**
	 * 没有选中的标记
	 */
	public static final int INVALID_ITEM = -1;

	// 默认选择的item
	protected int selectedItem = INVALID_ITEM;

	@Override
	public int getCount() {
		return 0;
	}

	@Override
	public Object getItem(int arg0) {
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		return null;
	}

	/**
	 * 设置选中的item并刷新适配器
	 * 
	 * @param selectedItem
	 *            位置
	 */
	public void setSelectedItem(int selectedItem) {
		this.selectedItem = selectedItem;
		this.notifyDataSetChanged();
	}

}
